<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta name="description" content="&amp;#x524D;&amp;#x63D0; &amp;#x5199;&amp;#x8FD9;&amp;#x90E8;&amp;#x7247;&amp;#x6587;&amp;#x7AE0;&amp;#x662F;&amp;#x4E3A;&amp;#x4E86;&amp;#x5904;&amp;#x7406;&amp;#x4E0A;&amp;#x4F20;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google play console&amp;#x4E4B;&amp;#x540E;Google&amp;#x5206;&amp;#x914">
<meta property="og:type" content="article">
<meta property="og:title" content="根据SHA1生成散列密钥的工具类">
<meta property="og:url" content="http://yoursite.com/2020/05/07/根据SHA1生成散列密钥的工具类/index.html">
<meta property="og:site_name" content="Silence潇湘夜雨">
<meta property="og:description" content="&amp;#x524D;&amp;#x63D0; &amp;#x5199;&amp;#x8FD9;&amp;#x90E8;&amp;#x7247;&amp;#x6587;&amp;#x7AE0;&amp;#x662F;&amp;#x4E3A;&amp;#x4E86;&amp;#x5904;&amp;#x7406;&amp;#x4E0A;&amp;#x4F20;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google play console&amp;#x4E4B;&amp;#x540E;Google&amp;#x5206;&amp;#x914">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2020-05-07T08:07:23.645Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="根据SHA1生成散列密钥的工具类">
<meta name="twitter:description" content="&amp;#x524D;&amp;#x63D0; &amp;#x5199;&amp;#x8FD9;&amp;#x90E8;&amp;#x7247;&amp;#x6587;&amp;#x7AE0;&amp;#x662F;&amp;#x4E3A;&amp;#x4E86;&amp;#x5904;&amp;#x7406;&amp;#x4E0A;&amp;#x4F20;&amp;#x5E94;&amp;#x7528;&amp;#x5230;Google play console&amp;#x4E4B;&amp;#x540E;Google&amp;#x5206;&amp;#x914">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2020/05/07/根据SHA1生成散列密钥的工具类/">





  <title>根据SHA1生成散列密钥的工具类 | Silence潇湘夜雨</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Silence潇湘夜雨</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Android开发一枚</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home //首页"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user //关于"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags  //标签"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th //分类"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive //归档"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-schedule">
          <a href="/schedule/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-calendar //日程表"></i> <br>
            
            日程表
          </a>
        </li>
      
        
        <li class="menu-item menu-item-sitemap">
          <a href="/sitemap.xml" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-sitemap //站点地图"></i> <br>
            
            站点地图
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/05/07/根据SHA1生成散列密钥的工具类/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Silence潇湘夜雨">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Silence潇湘夜雨">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">根据SHA1生成散列密钥的工具类</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-05-07T16:06:37+08:00">
                2020-05-07
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/工具类/" itemprop="url" rel="index">
                    <span itemprop="name">工具类</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  445
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  2
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="&#x524D;&#x63D0;"><a href="#&#x524D;&#x63D0;" class="headerlink" title="&#x524D;&#x63D0;"></a>&#x524D;&#x63D0;</h3><blockquote>
<p>&#x5199;&#x8FD9;&#x90E8;&#x7247;&#x6587;&#x7AE0;&#x662F;&#x4E3A;&#x4E86;&#x5904;&#x7406;&#x4E0A;&#x4F20;&#x5E94;&#x7528;&#x5230;Google play console&#x4E4B;&#x540E;Google&#x5206;&#x914D;&#x65B0;&#x7684;SHA1&#x7684;&#x95EE;&#x9898;&#x3002;&#x6839;&#x636E;&#x65B0;&#x7684;SHA1&#x751F;&#x6210;&#x65B0;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;&#xFF0C;&#x7528;&#x4E8E;Facebook&#x767B;&#x5F55;&#x586B;&#x5199;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;&#x3002;</p>
</blockquote>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * &#x8F6C;&#x6362;&#x5DE5;&#x5177;&#x7C7B;</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"> <span class="keyword">object</span> ConvertUtil {</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * &#x8F6C;&#x6362;</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@return</span> &#x8FD4;&#x56DE;&#x6563;&#x5217;&#x5BC6;&#x94A5;</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">fun</span> <span class="title">convert</span><span class="params">(input: <span class="type">String</span>, isCheck: <span class="type">Boolean</span>)</span></span>: String {</span><br><span class="line">    <span class="keyword">val</span> array: String</span><br><span class="line">    <span class="keyword">val</span> result = input(input, isCheck)</span><br><span class="line">    <span class="keyword">if</span> (result.length % <span class="number">2</span> != <span class="number">0</span>) {</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;123&quot;</span></span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">val</span> mArray = IntArray(result.length / <span class="number">2</span>)</span><br><span class="line">    <span class="keyword">for</span> (index <span class="keyword">in</span> <span class="number">0</span> until result.length / <span class="number">2</span>) {</span><br><span class="line">        <span class="keyword">val</span> h = result.substring(index * <span class="number">2</span>, index * <span class="number">2</span> + <span class="number">2</span>)</span><br><span class="line">        mArray[index] = h.toInt(<span class="number">16</span>)</span><br><span class="line">    }</span><br><span class="line">    array = convertTo64(mArray)</span><br><span class="line">    <span class="keyword">return</span> array</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * &#x8F93;&#x5165;&#x5185;&#x5BB9;</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> input   &#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> isCheck &#x662F;&#x5426;&#x53D6;&#x6D88;&#x9009;&#x62E9;OX</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@return</span> &#x8FD4;&#x56DE;&#x53D6;&#x6D88;OX&#x540E;&#x7684;&#x503C;</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">private</span> <span class="function"><span class="keyword">fun</span> <span class="title">input</span><span class="params">(input: <span class="type">String</span>, isCheck: <span class="type">Boolean</span>)</span></span>: String {</span><br><span class="line">    <span class="keyword">var</span> input = input</span><br><span class="line">    input = input.toUpperCase()</span><br><span class="line">    <span class="keyword">if</span> (isCheck) {</span><br><span class="line">        <span class="keyword">val</span> pattern = Pattern.compile(<span class="string">&quot;0X&quot;</span>)</span><br><span class="line">        <span class="keyword">val</span> matcher = pattern.matcher(input)</span><br><span class="line">        input = matcher.replaceAll(<span class="string">&quot;&quot;</span>)</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">val</span> pattern = Pattern.compile(<span class="string">&quot;[^A-Fa-f0-9]&quot;</span>)</span><br><span class="line">    <span class="keyword">val</span> matcher = pattern.matcher(input)</span><br><span class="line">    input = matcher.replaceAll(<span class="string">&quot;&quot;</span>)</span><br><span class="line">    <span class="keyword">return</span> input</span><br><span class="line">}</span><br></pre></td></tr></table></figure>

<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * &#x8F6C;&#x6362;&#x4E3A;64&#x4E3A;&#x7684;String&#x5B57;&#x7B26;&#x4E32;</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> input int &#x6570;&#x7EC4;</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@return</span> &#x8F6C;&#x6362;&#x540E;&#x7684;&#x6563;&#x5217;&#x5BC6;&#x94A5;</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">private</span> <span class="function"><span class="keyword">fun</span> <span class="title">convertTo64</span><span class="params">(input: <span class="type">IntArray</span>)</span></span>: String {</span><br><span class="line">    <span class="keyword">val</span> base64_chars = <span class="string">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;</span></span><br><span class="line">    <span class="keyword">var</span> ret = <span class="string">&quot;&quot;</span></span><br><span class="line">    <span class="keyword">var</span> i = <span class="number">0</span></span><br><span class="line">    <span class="keyword">var</span> j = <span class="number">0</span></span><br><span class="line">    <span class="keyword">val</span> char_array_3 = IntArray(<span class="number">3</span>)</span><br><span class="line">    <span class="keyword">val</span> char_array_4 = IntArray(<span class="number">4</span>)</span><br><span class="line">    <span class="keyword">var</span> in_len = input.size</span><br><span class="line">    <span class="keyword">var</span> pos = <span class="number">0</span></span><br><span class="line">    <span class="keyword">while</span> (in_len-- != <span class="number">0</span>) {</span><br><span class="line">        char_array_3[i++] = input[pos++]</span><br><span class="line">        <span class="keyword">if</span> (i == <span class="number">3</span>) {</span><br><span class="line">            char_array_4[<span class="number">0</span>] = char_array_3[<span class="number">0</span>] and <span class="number">0xfc</span> shr <span class="number">2</span></span><br><span class="line">            char_array_4[<span class="number">1</span>] =</span><br><span class="line">                (char_array_3[<span class="number">0</span>] and <span class="number">0x03</span> shl <span class="number">4</span>) + (char_array_3[<span class="number">1</span>] and <span class="number">0xf0</span> shr <span class="number">4</span>)</span><br><span class="line">            char_array_4[<span class="number">2</span>] =</span><br><span class="line">                (char_array_3[<span class="number">1</span>] and <span class="number">0x0f</span> shl <span class="number">2</span>) + (char_array_3[<span class="number">2</span>] and <span class="number">0xc0</span> shr <span class="number">6</span>)</span><br><span class="line">            char_array_4[<span class="number">3</span>] = char_array_3[<span class="number">2</span>] and <span class="number">0x3f</span></span><br><span class="line">            i = <span class="number">0</span></span><br><span class="line">            <span class="keyword">while</span> (i &lt; <span class="number">4</span>) {</span><br><span class="line">                ret += base64_chars[char_array_4[i]]</span><br><span class="line">                i++</span><br><span class="line">            }</span><br><span class="line">            i = <span class="number">0</span></span><br><span class="line">        }</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">if</span> (i != <span class="number">0</span>) {</span><br><span class="line">        j = i</span><br><span class="line">        <span class="keyword">while</span> (j &lt; <span class="number">3</span>) {</span><br><span class="line">            char_array_3[j] = <span class="number">0</span></span><br><span class="line">            j++</span><br><span class="line">        }</span><br><span class="line">        char_array_4[<span class="number">0</span>] = char_array_3[<span class="number">0</span>] and <span class="number">0xfc</span> shr <span class="number">2</span></span><br><span class="line">        char_array_4[<span class="number">1</span>] = (char_array_3[<span class="number">0</span>] and <span class="number">0x03</span> shl <span class="number">4</span>) + (char_array_3[<span class="number">1</span>] and <span class="number">0xf0</span> shr <span class="number">4</span>)</span><br><span class="line">        char_array_4[<span class="number">2</span>] = (char_array_3[<span class="number">1</span>] and <span class="number">0x0f</span> shl <span class="number">2</span>) + (char_array_3[<span class="number">2</span>] and <span class="number">0xc0</span> shr <span class="number">6</span>)</span><br><span class="line">        char_array_4[<span class="number">3</span>] = char_array_3[<span class="number">2</span>] and <span class="number">0x3f</span></span><br><span class="line">        j = <span class="number">0</span></span><br><span class="line">        <span class="keyword">while</span> (j &lt; i + <span class="number">1</span>) {</span><br><span class="line">            ret += base64_chars[char_array_4[j]]</span><br><span class="line">            j++</span><br><span class="line">        }</span><br><span class="line">        <span class="keyword">while</span> (i++ &lt; <span class="number">3</span>) ret += <span class="string">&apos;=&apos;</span></span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">return</span> ret</span><br><span class="line">}</span><br><span class="line"> }</span><br></pre></td></tr></table></figure>

<h3 id="&#x7528;&#x6CD5;"><a href="#&#x7528;&#x6CD5;" class="headerlink" title="&#x7528;&#x6CD5;"></a>&#x7528;&#x6CD5;</h3><figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ConvertUtil.convert( SHA1&#x5B57;&#x7B26;&#x4E32;, <span class="literal">true</span>)</span><br></pre></td></tr></table></figure>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/04/09/SDK支付之PayWall支付接入/" rel="next" title="SDK支付之PayWall支付接入）">
                <i class="fa fa-chevron-left"></i> SDK支付之PayWall支付接入）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/06/22/乐推SDK接入流程/" rel="prev" title="乐推SDK接入流程说明">
                乐推SDK接入流程说明 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Silence潇湘夜雨</p>
              <p class="site-description motion-element" itemprop="description">Android开发一枚</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">55</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/muyishuangfeng" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/1e2eec6f972c" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/58df0abf61ff4b006b115e43" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-star"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://twitter.com/yangke20792452" target="_blank" title="Twitter">
                      
                        <i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#前提"><span class="nav-number">1.</span> <span class="nav-text">前提</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#用法"><span class="nav-number">2.</span> <span class="nav-text">用法</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Silence潇湘夜雨</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">114.8k</span>
  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>




        







        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618},"display":{"superSample":2,"width":150,"height":300,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":false},"react":{"opacityDefault":0.5,"opacityOnHover":0.5},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
